#include <stdio.h>

void print_array(int **arr, int rows, int cols)
{
    for (int i = 0; i < rows; i++)
    {
        for (int j = 0; j < cols; j++)
        {
            printf("%d ", arr[i][j]);
        }
        printf("\n");
    }
}

int main()
{
    int arr[3][4] = {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}};

    int *ptr_arr[3];//建立一个int指针数组,存放每一行行首地址
    for (int i = 0; i < 3; i++)
    {
        ptr_arr[i] = arr[i];
    }

    print_array(ptr_arr, 3, 4);

    return 0;
}
